// ReSharper disable InconsistentNaming

using System;
using System.Collections.Generic;
using System.IO;
using ImageProcessing.Detectors;
using ImageProcessing.PointsSampler;
using NUnit.Framework;

namespace ImageProcessing.Tests.Engine
{
#if DEVMACINE
    [TestFixture]
#else
    [TestFixture, Ignore]
#endif
    public class RawImageProcessingEngineTestTests : ImageProcessingEngineTestBase
    {

        private readonly List<string> _rawFolders = new List<string>()
                                                          {
                                                              "USB", 
                                                          };

        private readonly List<string> _listTemplates = new List<string>()
                                                          {
                                                              "TestPics\\usb1.jpg",
                                                          };

        private readonly List<List<string>> _listCompares = new List<List<string>>();


        public IEnumerable<TestCaseData> TestCasesInput
        {
            get
            {
                foreach (var detectorType in Enum.GetValues(typeof(DetectorType)))
                {
                    foreach (var sampleType in Enum.GetValues(typeof(InterestPointsSamplerFactory.SampleType)))
                    {
                        for (int i = 0; i < _rawFolders.Count; i++)
                        {
                            // get files for the raw folder
                            var files = Directory.GetFiles("TestPics\\Raw\\" + _rawFolders[i]);
                            _listCompares.Add(new List<string>(files));
                            TestCaseData.Add(new TestCaseData(CameraMode.y, detectorType, sampleType, files[0], _listCompares[i]));
                        }
                    }
                }

                return TestCaseData;
            }
        }

        [TestCaseSource("TestCasesInput")]
        public void Start_PointsDetector_Equal(CameraMode cameraMode, DetectorType detectorType, InterestPointsSamplerFactory.SampleType sampleType, string learnFileName, List<string> compareFileNames)
        {
            BaseTester(cameraMode, detectorType, sampleType, learnFileName, compareFileNames);
        }
    }
}